import { memo } from "react";
import { SectionFooterWrapper } from "./style";
import IconMoreArrow from "../../asset/svgs/icon_more";
import {useNavigate} from "react-router-dom";

export const SectionFooter = memo(
    (props) => {
        const { name } = props;
        let showMessage = "查看更多";
        if (name)
        {
            showMessage = `查看更多${name}房源`    
        }
        
        const navigate = useNavigate();
        const Clickhandle = () => {
            navigate('/entire');
        }

        return (
            <SectionFooterWrapper color={name&&"#00848A"} onClick={Clickhandle}>
                <div className="text">{ showMessage}</div>
              <div className="icon"><IconMoreArrow></IconMoreArrow></div>
            </SectionFooterWrapper>
        )
    }
)